local GuiService = game:GetService("GuiService");
local UserInputService = game:GetService("UserInputService");
local Postie = _G.CommonOHOH.load.Postie();
local LocalPlayer = game:GetService("Players").LocalPlayer;
local ReplicatedStorage = game:GetService("ReplicatedStorage");


game:GetService("ScriptContext").Error:Connect(function(message, stackTrace, scriptInst)
	if not scriptInst then
		return
	end

	local scriptName = nil
	local ok, _ = pcall(function()
		scriptName = scriptInst:GetFullName() -- Can't get name of some scripts because of security permission
	end)
	if not ok then
		return
	end

	ReplicatedStorage.GameAnalyticsError:FireServer(message, stackTrace, scriptName)
end)

Postie.setCallback("getPlatform", function()
	if GuiService:IsTenFootInterface() then
		return "Console";
	end;
	if UserInputService.TouchEnabled and not UserInputService.MouseEnabled then
		return "Mobile";
	end;
	return "Desktop";
end);

Postie.setCallback("getCustomUserId", function()
	local player = game.Players.LocalPlayer
	return player.DisplayName
end)


return {};
